package top.pengdev.esoffice.util;


import top.pengdev.esoffice.common.dto.ResultData;
import top.pengdev.esoffice.common.model.Pager;

/**
 * ResultDataUtils class
 *
 * @author pengdev
 * @description
 * @date 2020-04-08 16:04
 **/
public class ResultDataUtils {

    public static ResultData success(){
        return new ResultData(200, "success", null, null);
    }

    public static ResultData success(Object data){
        return new ResultData(200, "success", data, null);
    }

    public static ResultData success(Object data, Pager pager){
        return new ResultData(200, "success", data, pager);
    }

    public static ResultData success(String msg, Object data){
        return new ResultData(200, msg, data, null);
    }

    public static ResultData success(String msg, Object data, Pager pager){
        return new ResultData(200, msg, data, pager);
    }

    public static ResultData error(Integer code, String msg){
        return new ResultData(code, msg, null, null);
    }

}
